<template>
  <div>
    <Row>
      <Col span="12">
        <Table :columns="columns" :data="data" border />
      </Col>
    </Row>
  </div>
</template>
<script>
export default {
  name: 'table-colspan',
  data () {
    return {
      columns: [
        {
          title: '科目',
          align:"center",
          width: 160,
          key: 'courseName',
        },
        {
          
          title: '2019/6/20',
          align: 'center',
          children: [
            {
              key: 'time1',
              title: '8:30-9:30',
              align: 'center',
              minWidth: 160
            },
            {
              key: 'time2',
              title: '9:45-10:45',
              align: 'center',
              minWidth: 160
            },
            {
              key: 'time3',
              title: '11:00-12:00',
              align: 'center',
              width: 160
            },
            {
              key: 'time4',
              title: '13:30-14:30',
              align: 'center',
              width: 160
            }
          ]
        },
      ],
      data: []
    }
  },
  methods: {
    init () {
      this.getDataList()
    },
    show (index) {
      this.$Modal.info({
        title: '学生基本信息',
        content: `姓名：${this.data[index].name}<br>班级：${this.data[index].className}<br>学号：${this.data[index].studentNo}`
      })
    },
    remove (index) {
      this.data.splice(index, 1)
    },
    getDataList () {
      this.data = [
        {
          "courseName":"",
          "time1":"图形图像处理（电商实训室）",
          "time2":"网页制作（机房）",
        },
        {
          "courseName":"16级电商",
          "time1":"王蕊",
          "time2":"张菁屏",
        },
        {
          "courseName":"",
          "time1":"结算与汇兑",
        },
        {
          "courseName":"16级会计",
          "time1":"刘怡临",
        },
        {
          "courseName":"",
          "time1":"英语口语（开卷）",
          "time2":"综合实训",
        },
        {
          "courseName":"16级轨道1",
          "time1":"董晓净",
          "time2":"李昀峰",
        },
        {
          "courseName":"16级轨道2",
          "time1":"董晓净",
          "time2":"李昀峰",
        },
        {
          "courseName":"16级轨道3",
          "time1":"董晓净",
          "time2":"李昀峰",
        },
        {
          "courseName":"16级轨道4",
          "time1":"董晓净",
          "time2":"李昀峰",
        },
         {
          "courseName":"",
          "time1":"航空服务英语综合",
          "time2":"民航货物运输实务",
          "time3":"民航服务心理学",
          "time4":"航空市场营销",
        },
         {
          "courseName":"16级民航1",
          "time1":"赵娜",
          "time2":"高山",
          "time3":"李美莹",
          "time4":"王健楠",
        },
         {
          "courseName":"16级民航2",
          "time1":"赵娜",
          "time2":"高山",
          "time3":"李美莹",
          "time4":"王健楠",
        },
         {
          "courseName":"16级民航3",
          "time1":"赵娜",
          "time2":"高山",
          "time3":"李美莹",
          "time4":"王健楠",
        },
      ]
    }
  },
  mounted () {
    this.init()
  }
}
</script>
